<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>
    if (!window.testRunner) {
        document.write("This test does not work in manual mode.");
    } else {
        var initialResolution = window.devicePixelRatio;
        shouldBeTrue('matchMedia("(resolution: " + initialResolution + "dppx)").matches');
        shouldBeTrue('matchMedia("(-webkit-device-pixel-ratio: " + initialResolution + ")").matches');

        testRunner.zoomPageIn();

        shouldBeTrue('matchMedia("(resolution: " + initialResolution * 1.2 + "dppx)").matches');
        shouldBeTrue('matchMedia("(-webkit-device-pixel-ratio: " + initialResolution * 1.2 + ")").matches');

        testRunner.zoomPageOut();
        testRunner.zoomPageOut();

        shouldBeTrue('matchMedia("(resolution: " + initialResolution / 1.2 + "dppx)").matches');
        shouldBeTrue('matchMedia("(-webkit-device-pixel-ratio: " + initialResolution / 1.2 + ")").matches');
    }
</script>
